<div class="content-section" id="myContent" >
    <div class="title col-sm-12">
        <div class="col-sm-2">
            <span>{{title}}</span>
        </div>
        <div class="col-sm-10 pull-right">
            <button type="button"
                    class="pull-right"
                    pButton
                    (click)="goBack()"
                    icon="fa-close"
                    style="width: 30px"></button>
        </div>
    </div>
    <form [formGroup]="myForm" class="form-horizontal"  (ngSubmit)="save()">
        <div class="form-group">
            <label class=" title-style col-sm-2 control-label text-align-left">基本信息</label>
        </div>
        <div class="form-group ">
            <label class="col-sm-2 control-label">
                <span ngClass="start_red">*</span>房间归属：
            </label>
            <div class="col-sm-10 ui-fluid-no-padding">
                <div class="col-sm-8 ui-fluid ui-fluid-no-padding">
                    <input type="text" pInputText
                           name="department"
                           readonly
                           [(ngModel)]="roomObj.father"
                           formControlName="father"
                           class="form-control cursor_not_allowed"/>
                    <div class="ui-message ui-messages-error ui-corner-all" *ngIf="father">
                    <i class="fa fa-close"></i>
                    不能为空
                    </div>

                </div>
                <div class="col-sm-1 ui-fluid-no-padding ui-padding-10px">
                    <button ngClass="ui-g-12 ui-fluid-no-padding" pButton type="button"  label="选择" (click)="show('room')"></button>
                </div>
                <div class="col-sm-1 ui-fluid-no-padding ui-padding-10px">
                    <button ngClass="ui-g-12 ui-fluid-no-padding" pButton type="button"  label="清空" (click)="clear('room')"></button>
                </div>
            </div>
        </div>
        <div class="form-group ">
            <label class="col-sm-2 control-label">
                <span ngClass="start_red">*</span>房间名称：
            </label>
            <div class="col-sm-4 ui-fluid-no-padding ui-fluid">
                <input type="text"
                       class=" form-control"
                       pInputText
                       [(ngModel)]="roomObj.name"
                       formControlName="name"/>
                <div class="ui-message ui-messages-error ui-corner-all" *ngIf="name">
                    <i class="fa fa-close"></i>
                    不能为空
                </div>
            </div>
            <label class="col-sm-2 control-label">
                <span ngClass="start_red">*</span>房间类型：</label>
            <div class="col-sm-4 ui-fluid-no-padding">
                <p-dropdown [options]="types"
                            [(ngModel)]="roomObj.room_type"
                            (onFocus)="onFocus()"
                            placeholder="{{ roomObj.room_type }}"
                            [ngModelOptions]="{standalone: true}"
                            [style]="{'width':'100%'}"
                ></p-dropdown>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label" *ngIf="displayDefault">
                <span ngClass="start_red">*</span>规划功率(Kw)：
            </label>
            <label class="col-sm-2 control-label" *ngIf="displayPowerOrFacility">
                <span ngClass="start_red">*</span>规划输出功率(Kw)：
            </label>
            <div class="col-sm-4 ui-fluid-no-padding ui-fluid">
                <input type="number"
                       class=" form-control"
                       pInputText
                       [(ngModel)]="roomObj.planning_power"
                       formControlName="planning_power"/>
                <div class="ui-message ui-messages-error ui-corner-all" *ngIf="planning_power">
                    <i class="fa fa-close"></i>
                    不能为空
                </div>

            </div>
            <label class="col-sm-2 control-label" *ngIf="displayDefault">
                <span ngClass="start_red">*</span>规划制冷量(Kw)：</label>
            <div class="col-sm-4 ui-fluid-no-padding" *ngIf="displayDefault">
                <input type="number"
                       class=" form-control"
                       pInputText
                       [(ngModel)]="roomObj.planning_refrigerating_capacity"
                       formControlName="planning_refrigerating_capacity"/>
                <div class="ui-message ui-messages-error ui-corner-all" *ngIf="planning_refrigerating_capacity">
                    <i class="fa fa-close"></i>
                    不能为空
                </div>
            </div>
            <label class="col-sm-2 control-label" *ngIf="displayPowerOrFacility">
                <span ngClass="start_red">*</span>面积(M2)：</label>
            <div class="col-sm-4 ui-fluid-no-padding" *ngIf="displayPowerOrFacility">
                <input type="number"
                       class=" form-control"
                       pInputText
                       [(ngModel)]="roomObj.area"
                       formControlName="area"/>
                <div class="ui-message ui-messages-error ui-corner-all" *ngIf="area">
                    <i class="fa fa-close"></i>
                    不能为空
                </div>
            </div>
        </div>
        <div class="form-group" *ngIf="displayDefault">
            <label class="col-sm-2 control-label" >
                <span ngClass="start_red">*</span>UPS功率(Kw)：</label>
            <div class="col-sm-4 ui-fluid-no-padding ui-fluid">
                <input type="number"
                       class=" form-control"
                       pInputText
                       [(ngModel)]="roomObj.ups_power"
                       formControlName="ups_power"/>
                <div class="ui-message ui-messages-error ui-corner-all" *ngIf="ups_power">
                    <i class="fa fa-close"></i>
                    不能为空
                </div>
            </div>
            <label class="col-sm-2 control-label" >
                <span ngClass="start_red">*</span>规划机架位(个)：</label>
            <div class="col-sm-4 ui-fluid-no-padding">
                <input type="number"
                       class=" form-control"
                       pInputText
                       [(ngModel)]="roomObj.planning_rack"
                       formControlName="planning_rack"/>
                <div class="ui-message ui-messages-error ui-corner-all" *ngIf="planning_rack">
                    <i class="fa fa-close"></i>
                    不能为空
                </div>
            </div>
        </div>
        <div class="form-group" *ngIf="displayDefault">
            <label class="col-sm-2 control-label" >
                <span ngClass="start_red">*</span>规划网口数(个)：</label>
            <div class="col-sm-4 ui-fluid-no-padding ui-fluid">
                <input type="number"
                       class=" form-control"
                       pInputText
                       [(ngModel)]="roomObj.planning_network_port"
                       formControlName="planning_network_port"/>
                <div class="ui-message ui-messages-error ui-corner-all" *ngIf="planning_network_port">
                    <i class="fa fa-close"></i>
                    不能为空
                </div>
            </div>
            <label class="col-sm-2 control-label">
                <span ngClass="start_red">*</span>规划带宽(MB)：</label>
            <div class="col-sm-4 ui-fluid-no-padding">
                <input type="number"
                       class=" form-control"
                       pInputText
                       formControlName="planning_network_bandwidth"
                       [(ngModel)]="roomObj.planning_network_bandwidth"/>
                <div class="ui-message ui-messages-error ui-corner-all" *ngIf="planning_network_bandwidth">
                    <i class="fa fa-close"></i>
                    不能为空
                </div>
            </div>
        </div>
        <div class="form-group" *ngIf="displayDefault">
            <label class="col-sm-2 control-label" >
                <span ngClass="start_red">*</span>可用性级别：</label>
            <div class="col-sm-4 ui-fluid-no-padding ui-fluid">
                  <span class="ui-fluid">
                    <p-radioButton name="group" value="A" label="A" [(ngModel)]="roomObj.availability_level" [ngModelOptions]="{standalone: true}" inputId="preopt1"></p-radioButton>
                    <p-radioButton name="group" value="B" label="B" [(ngModel)]="roomObj.availability_level" [ngModelOptions]="{standalone: true}" inputId="preopt2"></p-radioButton>
                        <p-radioButton name="group" value="B+" label="B+" [(ngModel)]="roomObj.availability_level" [ngModelOptions]="{standalone: true}" inputId="preopt3"></p-radioButton>
                    <p-radioButton name="group" value="C" label="C" [(ngModel)]="roomObj.availability_level"  [ngModelOptions]="{standalone: true}" inputId="preopt4"></p-radioButton>
                </span>
            </div>
            <label class="col-sm-2 control-label">
                <span ngClass="start_red">*</span>面积(M2)：</label>
            <div class="col-sm-4 ui-fluid-no-padding">
                <input type="number"
                       class=" form-control"
                       pInputText
                       [(ngModel)]="roomObj.area"
                       formControlName="area"/>
                <div class="ui-message ui-messages-error ui-corner-all" *ngIf="area">
                    <i class="fa fa-close"></i>
                    不能为空
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">
                <span ngClass="start_red">*</span>机房管理员：</label>
            <div class="col-sm-4 ui-fluid-no-padding">
                <div class="col-sm-6 ui-fluid ui-fluid-no-padding">
                    <input type="text" pInputText
                           readonly
                           [(ngModel)]="roomObj.room_manager"
                           formControlName="room_manager"
                           class=" form-control cursor_not_allowed"
                    />
                    <div class="ui-message ui-messages-error ui-corner-all" *ngIf="room_manager">
                        <i class="fa fa-close"></i>
                        不能为空
                    </div>
                </div>
                <div class="col-sm-3 ui-fluid-no-padding ui-padding-10px">
                    <button  ngClass="ui-g-12 ui-fluid-no-padding"  pButton type="button" (click)="show('managements')" label="选择"></button>
                </div>
                <div class="col-sm-3 ui-fluid-no-padding ui-padding-10px">
                    <button  ngClass="ui-g-12 ui-fluid-no-padding"  pButton type="button" (click)="clear('managements')" label="清空"></button>
                </div>
            </div>
            <label class="col-sm-2 control-label">
                <span ngClass="start_red">*</span>联系电话：</label>
            <div class="col-sm-4 ui-fluid-no-padding ui-fluid">
                <input type="text"
                        class=" form-control cursor_not_allowed"
                        pInputText
                        readonly
                        [(ngModel)]="roomObj.room_manager_phone"
                       formControlName="room_manager_phone"/>
                <div class="ui-message ui-messages-error ui-corner-all" *ngIf="room_manager_phone">
                    <i class="fa fa-close"></i>
                    不能为空
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class=" title-style col-sm-2 control-label text-align-left">告警阈值</label>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">功率(%)：</label>
            <div class="col-sm-4 ui-fluid-no-padding ui-fluid">
                <input type="number"
                       class=" form-control"
                       pInputText
                       [(ngModel)]="roomObj.threshold_power"
                       [ngModelOptions]="{standalone: true}"/>
            </div>
            <label class="col-sm-2 control-label">制冷(%)：</label>
            <div class="col-sm-4 ui-fluid-no-padding">
                <input type="number"
                       class=" form-control"
                       pInputText
                       [(ngModel)]="roomObj.threshold_refrigeration"
                       [ngModelOptions]="{standalone: true}"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">机架位(%)：</label>
            <div class="col-sm-4 ui-fluid-no-padding ui-fluid">
                <input type="number"
                       class=" form-control"
                       pInputText
                       [(ngModel)]="roomObj.threshold_rack"
                       [ngModelOptions]="{standalone: true}"/>
            </div>
            <label class="col-sm-2 control-label">网口数(%)：</label>
            <div class="col-sm-4 ui-fluid-no-padding">
                <input type="number"
                       class=" form-control"
                       pInputText
                       [(ngModel)]="roomObj.threshold_network_port"
                       [ngModelOptions]="{standalone: true}"/>
            </div>
        </div>
        <!--<div class="form-group">-->
            <!--<label class="col-sm-2 control-label text-align-left">补充参数</label>-->
        <!--</div>-->
        <!--<div class="form-group">-->
            <!--<label class="col-sm-2 control-label">功率(KW)：</label>-->
            <!--<div class="col-sm-4 ui-fluid-no-padding ui-fluid">-->
                <!--<input type="number"-->
                       <!--class=" form-control"-->
                       <!--pInputText-->
                       <!--[(ngModel)]="roomObj.addtional_power"-->
                       <!--[ngModelOptions]="{standalone: true}"/>-->
            <!--</div>-->
            <!--<label class="col-sm-2 control-label">制冷(KW)：</label>-->
            <!--<div class="col-sm-4 ui-fluid-no-padding">-->
                <!--<input type="number"-->
                       <!--class=" form-control"-->
                       <!--pInputText-->
                       <!--[(ngModel)]="roomObj.addtional_refrigeration"-->
                       <!--[ngModelOptions]="{standalone: true}"/>-->
            <!--</div>-->
        <!--</div>-->
        <!--<div class="form-group">-->
            <!--<label class="col-sm-2 control-label">机架位(个)：</label>-->
            <!--<div class="col-sm-4 ui-fluid-no-padding ui-fluid">-->
                <!--<input type="number"-->
                       <!--class=" form-control"-->
                       <!--pInputText-->
                       <!--[(ngModel)]="roomObj.addtional_rack"-->
                       <!--[ngModelOptions]="{standalone: true}"/>-->
            <!--</div>-->
            <!--<label class="col-sm-2 control-label">网口数(个)：</label>-->
            <!--<div class="col-sm-4 ui-fluid-no-padding">-->
                <!--<input type="number"-->
                       <!--class=" form-control"-->
                       <!--pInputText-->
                       <!--[(ngModel)]="roomObj.addtional_network_port"-->
                       <!--[(ngModel)]="roomObj.addtional_network_port"-->
                       <!--[ngModelOptions]="{standalone: true}"/>-->
            <!--</div>-->
        <!--</div>-->
        <div class="form-group ">
            <div class="col-sm-12 ui-no-padding-left-15px ">
                <button class="pull-right  ui-button-secondary" pButton   (click)="goBack()" type="button" label="取消"></button>
                <button  class="pull-right ui-margin-right-10px" pButton type="submit" label="保存" ></button>
            </div>
        </div>
    </form>
    <p-dialog header="请选择房间归属" [(visible)]="displayRoom" modal="modal" width="width" [responsive]="true" minHeight="500" (onHide)="onHide('room')">
        <p-tree [value]="treeDatas"
                selectionMode="single"
                [(selection)]="selectedRoom"
        ></p-tree>
        <p-footer>
            <button type="button" pButton icon="fa-check" (click)="sure('room')" label="确定"></button>
            <button type="button" pButton icon="fa-close" (click)="hide('room')"
                    class="ui-button-secondary" label="取消"></button>
        </p-footer>
    </p-dialog>
    <!--<p-dialog header="请选择机房管理员" [(visible)]="displayManagements" modal="modal" width="width" [responsive]="true" minHeight="500" (onHide)="onHide('managements')">-->
        <!--<p-tree [value]="filesTree4"-->
                <!--selectionMode="single"-->
                <!--[(selection)]="selected"-->
                <!--(onNodeExpand)="nodeExpand($event)"-->
        <!--&gt;</p-tree>-->
        <!--<p-footer>-->
            <!--<button type="button" pButton icon="fa-check" (click)="sure('managements')" label="确定"></button>-->
            <!--<button type="button" pButton icon="fa-close" (click)="hide('managements')"-->
                    <!--class="ui-button-secondary" label="取消"></button>-->
        <!--</p-footer>-->
    <!--</p-dialog>-->
    <app-personel-dialog *ngIf="displayManagements"
                         (dataEmitter)="dataEmitter($event)"
                         (displayEmitter)="displayEmitter($event)"></app-personel-dialog>
    <p-growl [(value)]="message"></p-growl>
</div>
